<%@ page contentType="text/html;charset=utf-8" language="java"%>
<%@include file="./base.jsp" %>
<div class="wt_head">
  <div class="logo"><a href="index.jsp">约导游</a></div>
  <div class="shell"> <strong id="selIndexCityId">常州</strong><span id="menuBtn">切换城市</span> </div>
  <div class="topnav"><a href="join.jsp">免费注册</a>　 ${sessionScope.loginUser.userId!=null?"<a href=\"javascript:logout()\">|　退出</a>":"|　<a href=\"login.jsp\">请登录</a>"}　|　<a target="_blank" href="about.jsp">联系我们</a></div></div>
 <div id="menu" style="display:none;">
  <ul>
    <li><a href="#">北京</a></li>
    <li><a href="#">上海</a></li>
    <li><a href="#">武汉</a></li>
    <li><a href="#">广州</a></li>
    <li><a href="#">深圳</a></li>
    <li  class="focus"><a href="#">常州</a></li>
    <li><a href="#">南京</a></li>
    <li><a href="#">成都</a></li>
    <li><a href="#">天津</a></li>
    <li><a href="#">西安</a></li>
    <li><a href="#">福州</a></li>
    <li><a href="#">无锡</a></li>
    <li><a href="#">苏州</a></li>
    <li><a href="#">杭州</a></li>
    <li><a href="#">镇江</a></li>
    <li><a href="#">扬州</a></li>
  </ul>
 <!--   <div class="menufoot"><a href="#">其它城市？</a></div>-->
</div>
<!--head end--> 
<!--nav begin-->
<div class="wt_nav">
  <div class="daohang clearfix"><a href="index.jsp" class="current">首页</a> ${sessionScope.loginUser.userId!=null?"<a href=\"javascript:myIndex();\">我的主页</a>":""}<a href="lxslist.jsp">旅行社</a><a href="dylist.jsp">导游</a>
  <!--<a href="lxlist.html">线路</a><a href="zslist.jsp">旅游知识</a>  -->
  </div>
</div>
<script>
var selCity=$("#selIndexCityId").html(); 
$(function(){
	var currSelCity = getCurrCity();
	if(currSelCity!=null&& currSelCity!="") {
		$("#selIndexCityId").html(currSelCity);
	}
	
});
$('#menu li a').on('click',function (){
	 $('#menu li').removeClass('focus');
   $(this).parent().addClass('focus');
   $("#selIndexCityId").html($(this).html());
   document.getElementById('menu').style.display='none';
   $.cookie("selCity",$(this).html());
   var strUrl=window.location.href;
	var arrUrl=strUrl.split("/");
	var strPage=arrUrl[arrUrl.length-1];
	if(strPage.indexOf("index.jsp")>=0||strPage.indexOf("lxslist.jsp")>=0||strPage.indexOf("dylist.jsp")>=0) {
		location = location.href;
	}
   
})
function getCurrCity() {
	if($.cookie("selCity")){
		return $.cookie("selCity");
	}else{
		return selCity;
	}
}
function myIndex() {
	 if(loginUserType==0){
		  window.location.href='${path}/lxslogin.jsp';
	  }else if(loginUserType==1) {
		  window.location.href='${path}/lxslogin.jsp';
	  }else if(loginUserType==2){
		  window.location.href='${path}/dylogin_5.jsp'; 
	  };
	  if(loginUserType==-1){
		  window.location.href='${path}/adminlogin.jsp';
	  }
}
/*$(function ()
        {
            $(".daoyou ul li a img").mouseenter(function ()
            {
                $(this).css({
                    //position: "absolute",

                });
                $(this).stop().animate({
                    marginLeft: "-30px",
                    marginTop: "-30px",
                    width: "245px",
                    height: "245px",
                }, 400);
            });
            $(".daoyou ul li a img").mouseleave(function ()
            {
                $(this).stop().animate({
                    marginLeft: "0px",
                    marginTop: "0px",
                    width: "185px",
                    height: "185px",
                }, 400);
            });
        });*/
</script> 
<!--切换城市--> 
<script type="text/javascript">
//<![CDATA[
ldh={
    get:function (el){
        return typeof el=="string"?document.getElementById(el):el;
    },
    on:function(el,type,fn){
        el=this.get(el);
        el.attachEvent?
        el.attachEvent('on'+type,function(){fn.call(el,event)}):
        el.addEventListener(type,fn,false);
        return this
    },
    align:function (el,el2,x,y){
       var rect=this.get(el2).getBoundingClientRect(),x=x||0,y=y||0;
        el.style.top=rect.top+this.get(el2).offsetHeight+y+'px';
        el.style.left=rect.left+x+'px'
    },
   stop:function (e){
        e=e||window.event;
        e.stopPropagation&&e.stopPropagation();
        e.cancelBubble=true
    },
    onblur:function(el,fn) {
        el=this.get(el);
        this.on(el,'click',function (e){
            ldh.stop()
        }).on(document, 'click',function(e) {
            el.style.display='none';
        });
        return this
    }
};
ldh.onblur('menu').on('menuBtn','click',function (){
    var css=ldh.get('menu').style;
    if(css.display!='none')return ;
    ldh.align(ldh.get('menu'),this,-58,10);
    css.display= 'block';
    ldh.stop();
})

//]]>
</script>
